import { handleActions as createReducer } from 'redux-actions'
import { getListAction } from '../action/person.action'

const ininialState = {
  person: []
}

//  function reducer(state = ininialState, action) {
//   switch (action.type) {
//     case 'getListSuccess':
//       return {
//         person: action.payload
//       }
//     default:
//       return state
//   }
// }

const counterReducer = createReducer({
  'getListSuccess': (state, action) => {
    console.log(action)
    return {
      person: action.payload
    }
  }
}, ininialState)

export default counterReducer